<script>
	wx.ready(function () {
		var shareData = {
			title: "{$config['share']['share_title']}",
			desc: "{$config['share']['share_desc']}",
			link: "{$config['share']['share_url']}",
			imgUrl: "{php echo tomedia($config['share']['share_image'])}",
		};
	//分享朋友
		wx.onMenuShareAppMessage({
		    title: shareData.title,
		  	desc: shareData.desc,
		  	link: shareData.link,
		  	imgUrl:shareData.imgUrl,
		  	trigger: function (res) {
		  	},
		  	success: function (res) {
		  	},
		  	cancel: function (res) {
		  	},
		  	fail: function (res) {
		    	alert(JSON.stringify(res));
		  	}
		});
	//朋友圈
		wx.onMenuShareTimeline({
		  	title: shareData.title,
		  	link: shareData.link,
		  	imgUrl:shareData.imgUrl,
		  	trigger: function (res) {
		  	},
		  	success: function (res) {
		  	},
		  	cancel: function (res) {
		  	},
		  	fail: function (res) {
		    	alert(JSON.stringify(res));
		  	}
		});
		var shareAddress = {php echo json_encode($shareAddress)};
		WeixinJSBridge.invoke('editAddress',shareAddress,function(res){ 
		    if(res.err_msg=='edit_address:ok'){
		        $("#myname").val(res.userName);
		        $('#myphone').val(res.telNumber);
		        $('#detailed_address').val(res.addressDetailInfo);
		        var city = res.proviceFirstStageName+" "+res.addressCitySecondStageName+" "+res.addressCountiesThirdStageName;
		        $('#city-picker').val(city);
		    }
		});
	});
</script>
</body>
</html>